<script setup>

//语法糖
import {reactive, ref,watch,computed} from 'vue'
let str=ref("hello")
        let list=reactive([])
        let obj =reactive({})
        let cou =ref(0)
        let a=ref(2)
        let b=ref(0)
        let c=ref(0)
        let d =ref(0)
        let say=ref("老北京鸡肉卷真好吃")
        const sb=computed(()=>{
            let sb1=''
            if(a.value%2==0){
                sb1='sb'
            }
            else{
                sb1='nc'
            }
            return sb1

        })
        const add=()=>{
            c.value=a.value+b.value;
        }
        const one=watch(say,(new1,old)=>{
            console.log(new1,old)
        },)
      function add1(){
        c.value=a.value+b.value
      }  
</script>
<template>
    <h1>语法糖-Demo13</h1>
    <input type="text" v-model.number="a" @input="add"/>+
    <input type="text" v-model.number="b" @input="add"/>={{c}}
    <p>sb:{{sb}}</p>{{a%2==0}}
</template>
<style></style>